package com.xinyue.auto.reader.util;

import com.xinyue.auto.type.PageType;

public class PageUtil implements PageType{

	/**
	 * 验证是否合法的page模版
	 * 返回模版名称
	 * @param temp
	 * @return
	 * @throws Exception
	 */
	public static String validate(String temp) throws Exception {
		if(INDEX_A.equals(temp)) {
			return INDEX_A + ENDFIX;
		}else if(INDEX_B.equals(temp)) {
			return INDEX_B + ENDFIX;
		}else if(BUILD_A.equals(temp)) {
			return BUILD_A + ENDFIX;
		}else if(BUILD_B.equals(temp)) {
			return BUILD_B + ENDFIX;
		}else if(LOOK_A.equals(temp)) {
			return LOOK_A + ENDFIX;
		}
		
		throw new Exception("非法的page模版类型:" + temp);
	}
}
